import { BrowserRouter as Router , Route , Redirect } from 'react-router-dom'
import Home from './pages/Home';
import CityList from './pages/CityList';
import HouseDetail from './pages/HouseDetail';
import Map from './pages/Map'
import Login from './pages/Login'
import Registe from './pages/Registe'

function App() {
  return (
    <Router>
    <div className="App">
    

     {/* 配置导航菜单 */}
    
     {/* 默认路由匹配时，跳转到/home实现路由的重定向 */}
     <Route exact path='/' render={()=> <Redirect to="/home" />} />

     {/* 注册路由 */}
     <Route path="/home" component={Home}></Route>
     <Route path="/citylist" component={CityList}></Route>
     <Route path="/map" component={Map}></Route>

     {/* 房源详情的路由规则 */}
     <Route path="/detail/:id" component={HouseDetail} />
     <Route path="/login" component={Login} />
     <Route path="/registe" component={Registe} />
    </div>
    </Router>
  );
}

export default App;
